package com.wgo.precise.server.pdf;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;

public interface PdfFactory<C extends Object> {
	/**
	 * The method to implement that does the actual writing to the document (doc).
	 * It should make use of the pdfRegistry to process any writing to the docuemnt based on its children.
	 * @param concept
	 * @param doc
	 * @param pdfRegistry
	 * @param indentation  A number indicating what level this occurs on. This may be necessary to be able to format it nicely.
	 * @throws DocumentException
	 */
	public void writeElement(C concept, Document doc, int indentation) throws DocumentException;
	/**
	 * A string representing the concept type. Example "requirement". This String is used in the request parameter from the client to the server.
	 * @return
	 */
	public String getType();
	/**
	 * 
	 * @param concept
	 * @return Whether this factory is capable of writing to a document based on this concept
	 */
	public boolean isApplicable(Object concept);
	
	/**
	 * @return The business interface representing the concept. Example: Requirement.class
	 */
	public Class<C> getConceptClass();
	
	public void setRegistry(PdfFactoryRegistry registry);
}
